# encoding: utf-8
import jieba
import wordcloud

f = open("e:\\关于实施乡村振兴战略的意见.txt", 'r',encoding="utf8")
t = f.read()                   # t is string
f.close()
ls = jieba.lcut(t)             # ls is list
txt = " ".join(ls)             # txt is string
w = wordcloud.WordCloud( font_path="msyh.ttf", \
     width=1000, height=700, background_color="white") # font_path="msyh.ttc",
w.generate(txt)
w.to_file("grwordcloud.png")

